package com.qqt.csr.order.vo.req;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.qqt.csr.common.idempotent.RequestKeyParam;
import com.qqt.csr.common.operalog.OperaLogSchema;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@JsonIgnoreProperties(ignoreUnknown = true)
@Schema(name = "EditingWorkOrderReqVO", description = "创建工单请求参数")
public class EditingWorkOrderReqVO implements Serializable {
    @Serial
    private static final long serialVersionUID = -4378876184749066177L;
    /**
     * 主键
     */
    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED)
    @OperaLogSchema(desc = "主键id")
    @RequestKeyParam
    @NotNull(message = "主键id不能为空")
    private Long id;

    /**
     * 工单状态
     */
    @Schema(description = "当前工单状态", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "当前工单状态不能为空")
    private String status;

    /**
     * 工单内容
     */
    @Schema(description = "工单内容", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "工单内容不能为空")
    private String content;
    /**
     * 渠道id
     */
    @Schema(description = "渠道id")
    private String channelId;
    /**
     * 访客id
     */
    @Schema(description = "访客id")
    private String visitorId;
    /**
     * 关联的会话类型：0 不关联；1 机器人；2 人工
     */
    @Schema(description = "关联的会话类型：0 不关联；1 机器人；2 人工", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "关联的会话类型不能为空")
    @Min(value = 0, message = "关联的会话类型不能小于0")
    @Max(value = 2, message = "关联的会话类型不能大于2")
    private Integer conversationType;
    /**
     * 关联的会话id
     */
    @Schema(description = "关联的会话id")
    private String conversationId;
    /**
     * 优先级：0 低；1 一般；2 紧急
     */
    @Schema(description = "优先级：0 低；1 一般；2 紧急", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "优先级不能为空")
    @Min(value = 0, message = "优先级不能小于0")
    @Max(value = 2, message = "优先级不能大于2")
    private Integer priority;
    /**
     * 处理人id
     */
    @Schema(description = "处理人id")
    private Long designeeId;
    /**
     * 是否设置超时：0 否；1 是
     */
    @Schema(description = "是否设置超时：0 否；1 是", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否设置超时不能为空")
    @Min(value = 0, message = "是否设置超时不能小于0")
    @Max(value = 1, message = "是否设置超时不能大于1")
    private Integer timeoutFlag;
    /**
     * 超时时间，单位秒
     */
    @Schema(description = "超时时间，单位秒")
    @Min(value = 0, message = "超时时间不能小于0")
    private Long timeoutConfig;
    /**
     * 是否系统通知：0 否；1 是
     */
    @Schema(description = "是否系统通知：0 否；1 是", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否系统通知不能为空")
    @Min(value = 0, message = "是否系统通知不能小于0")
    @Max(value = 1, message = "是否系统通知不能大于1")
    @Builder.Default
    private Integer sysNotifyFlag = 1;
}
